import screenfull from "screenfull";

export default {
  data() {
    return {
      isFullscreen: false,
    };
  },
  methods: {
    isScreenFull(name) {
      if (!screenfull.isEnabled) {
        this.$message({
          message: "浏览器不支持全屏",
          type: "warning",
        });
        return false;
      }
      screenfull.toggle(this.$refs[name]);
      screenfull.on("change", () => {
        this.isFullscreen = screenfull.isFullscreen;
      });
    },
  },
};
